import 'package:meiyunapp/generated/json/base/json_convert_content.dart';

import 'error_entity.dart';

class BaseEntity<T> {
  int state;
  String msg;
  T data;
  ErrorEntity? errorEntity;

  BaseEntity(
      {required this.state,
      this.msg = "",
      this.errorEntity,
      required this.data});

  factory BaseEntity.fromJson(json) {
    return BaseEntity(
      state: json["state"],
      msg: json["msg"],
      data: JsonConvert.fromJsonAsT<T>(json["data"]),
    );
  }
}
